import request from "../utils/request"

export const getArticlesAPI = (params) => {
  return request({
    url:"/v1_0/mp/articles",
    params
  })
}

export const delArticlesAPI = (id) => {
  return request({
    url: "/v1_0/mp/articles/"+id,
    method: "DELETE"
  })
}

export const publishArticlesAPI = (data, draft = false) => {
  return request({
    url: "/v1_0/mp/articles?draft=" + draft,
    method: "POST",
    data
  })
}
// 编辑Api
export const publishArticlesUrlAPI = (data, draft = false) => {
  return request({
    url: "/v1_0/mp/articles/" + data.id + "?draft=" + draft,
    method: "put",
    data
  })
}

export const getArticlesListAPI = (id) => {
  return request({
    url: "/v1_0/mp/articles/" + id,
  })
}